/*
 * Created by JFormDesigner on Tue Feb 28 21:53:31 CST 2023
 */

package com.viking.gui.enterinformation;

import java.awt.event.*;

import com.viking.gui.datechooser.JDateChooser;
import lombok.var;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;

/**
 * @author cai
 */
public class PatientInformation extends JFrame {
    public PatientInformation() {
        initComponents();
    }

    private void searchPatient(ActionEvent e) {
        // TODO add your code here
    }

    /** 单击生日文本框后的事件*/
    private void birthdaytextField3MouseClicked(MouseEvent e) {
        JDateChooser gg = new JDateChooser();
        gg.showDateChooser();
        birthdaytextField3.setText(gg.getDateFormat("yyyy-MM-dd"));
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        namelabel1 = new JLabel();
        nametextField1 = new JTextField();
        genderlabel2 = new JLabel();
        gendercomboBox1 = new JComboBox<>();
        agelabel3 = new JLabel();
        birthdaylabel4 = new JLabel();
        birthdaytextField3 = new JTextField();
        phonelabel5 = new JLabel();
        phonetextField4 = new JTextField();
        subjectlabel6 = new JLabel();
        subjecttextField5 = new JTextField();
        hospitalNumberlabel7 = new JLabel();
        hospitalNumbertextField6 = new JTextField();
        caseHistorylabel8 = new JLabel();
        caseHistorytextField7 = new JTextField();
        savebutton1 = new JButton();
        cancelbutton2 = new JButton();
        scrollPane1 = new JScrollPane();
        table1 = new JTable();
        dlabel9 = new JLabel();
        label10 = new JLabel();
        pagelabel11 = new JLabel();
        upbutton3 = new JButton();
        downbutton4 = new JButton();
        changebutton5 = new JButton();
        deletebutton6 = new JButton();
        identifylabel12 = new JLabel();
        identifytextField9 = new JTextField();
        briefMedicalHistorylabel13 = new JLabel();
        searchButton = new JButton();
        scrollPane2 = new JScrollPane();
        briefMedicalHistoryeditorPane1 = new JEditorPane();
        comboBox2 = new JComboBox<>();
        agespinner1 = new JSpinner();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("\u60a3\u8005\u4fe1\u606f\u5f55\u5165");
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- namelabel1 ----
        namelabel1.setText("\u59d3\u540d\uff1a");
        contentPane.add(namelabel1);
        namelabel1.setBounds(new Rectangle(new Point(80, 35), namelabel1.getPreferredSize()));
        contentPane.add(nametextField1);
        nametextField1.setBounds(120, 30, 125, nametextField1.getPreferredSize().height);

        //---- genderlabel2 ----
        genderlabel2.setText("\u6027\u522b:");
        contentPane.add(genderlabel2);
        genderlabel2.setBounds(new Rectangle(new Point(275, 35), genderlabel2.getPreferredSize()));

        //---- gendercomboBox1 ----
        gendercomboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
            "\u7537",
            "\u5973"
        }));
        contentPane.add(gendercomboBox1);
        gendercomboBox1.setBounds(new Rectangle(new Point(315, 30), gendercomboBox1.getPreferredSize()));

        //---- agelabel3 ----
        agelabel3.setText("\u5e74\u9f84\uff1a");
        contentPane.add(agelabel3);
        agelabel3.setBounds(new Rectangle(new Point(445, 35), agelabel3.getPreferredSize()));

        //---- birthdaylabel4 ----
        birthdaylabel4.setText("\u751f\u65e5\uff1a");
        contentPane.add(birthdaylabel4);
        birthdaylabel4.setBounds(new Rectangle(new Point(640, 35), birthdaylabel4.getPreferredSize()));

        //---- birthdaytextField3 ----
        birthdaytextField3.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                birthdaytextField3MouseClicked(e);
            }
        });
        contentPane.add(birthdaytextField3);
        birthdaytextField3.setBounds(680, 30, 155, birthdaytextField3.getPreferredSize().height);

        //---- phonelabel5 ----
        phonelabel5.setText("\u7535\u8bdd\uff1a");
        contentPane.add(phonelabel5);
        phonelabel5.setBounds(new Rectangle(new Point(80, 95), phonelabel5.getPreferredSize()));
        contentPane.add(phonetextField4);
        phonetextField4.setBounds(120, 90, 125, phonetextField4.getPreferredSize().height);

        //---- subjectlabel6 ----
        subjectlabel6.setText("\u79d1\u522b\uff1a");
        contentPane.add(subjectlabel6);
        subjectlabel6.setBounds(new Rectangle(new Point(275, 95), subjectlabel6.getPreferredSize()));
        contentPane.add(subjecttextField5);
        subjecttextField5.setBounds(310, 90, 110, subjecttextField5.getPreferredSize().height);

        //---- hospitalNumberlabel7 ----
        hospitalNumberlabel7.setText("\u4f4f\u9662\u53f7:");
        contentPane.add(hospitalNumberlabel7);
        hospitalNumberlabel7.setBounds(new Rectangle(new Point(440, 95), hospitalNumberlabel7.getPreferredSize()));
        contentPane.add(hospitalNumbertextField6);
        hospitalNumbertextField6.setBounds(485, 90, 120, hospitalNumbertextField6.getPreferredSize().height);

        //---- caseHistorylabel8 ----
        caseHistorylabel8.setText("\u75c5\u5386\u53f7:");
        contentPane.add(caseHistorylabel8);
        caseHistorylabel8.setBounds(new Rectangle(new Point(630, 95), caseHistorylabel8.getPreferredSize()));
        contentPane.add(caseHistorytextField7);
        caseHistorytextField7.setBounds(680, 90, 155, caseHistorytextField7.getPreferredSize().height);

        //---- savebutton1 ----
        savebutton1.setText("\u4fdd\u5b58");
        contentPane.add(savebutton1);
        savebutton1.setBounds(new Rectangle(new Point(570, 255), savebutton1.getPreferredSize()));

        //---- cancelbutton2 ----
        cancelbutton2.setText("\u53d6\u6d88");
        contentPane.add(cancelbutton2);
        cancelbutton2.setBounds(new Rectangle(new Point(760, 255), cancelbutton2.getPreferredSize()));

        //======== scrollPane1 ========
        {

            //---- table1 ----
            table1.setModel(new DefaultTableModel(
                new Object[][] {
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                    {null, null, null, null, null, null, null, null, null, null},
                },
                new String[] {
                    "\u59d3\u540d", "\u6027\u522b", "\u5e74\u9f84", "\u751f\u65e5", "\u7535\u8bdd", "\u79d1\u522b", "\u4f4f\u9662\u53f7", "\u75c5\u5386\u53f7", "\u8eab\u4efd\u8bc1", "\u7b80\u8981\u75c5\u53f2"
                }
            ) {
                Class<?>[] columnTypes = new Class<?>[] {
                    String.class, Object.class, Object.class, Object.class, Object.class, Object.class, Object.class, Object.class, Object.class, Object.class
                };
                @Override
                public Class<?> getColumnClass(int columnIndex) {
                    return columnTypes[columnIndex];
                }
            });
            scrollPane1.setViewportView(table1);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(34, 295, 806, 245);

        //---- dlabel9 ----
        dlabel9.setText("\u7b2c");
        contentPane.add(dlabel9);
        dlabel9.setBounds(new Rectangle(new Point(35, 555), dlabel9.getPreferredSize()));
        contentPane.add(label10);
        label10.setBounds(new Rectangle(new Point(64, 490), label10.getPreferredSize()));

        //---- pagelabel11 ----
        pagelabel11.setText("\u9875");
        contentPane.add(pagelabel11);
        pagelabel11.setBounds(new Rectangle(new Point(110, 555), pagelabel11.getPreferredSize()));

        //---- upbutton3 ----
        upbutton3.setText("\u4e0a\u4e00\u9875");
        contentPane.add(upbutton3);
        upbutton3.setBounds(new Rectangle(new Point(164, 550), upbutton3.getPreferredSize()));

        //---- downbutton4 ----
        downbutton4.setText("\u4e0b\u4e00\u9875");
        contentPane.add(downbutton4);
        downbutton4.setBounds(new Rectangle(new Point(269, 550), downbutton4.getPreferredSize()));

        //---- changebutton5 ----
        changebutton5.setText("\u4fee\u6539");
        contentPane.add(changebutton5);
        changebutton5.setBounds(new Rectangle(new Point(475, 255), changebutton5.getPreferredSize()));

        //---- deletebutton6 ----
        deletebutton6.setText("\u5220\u9664");
        contentPane.add(deletebutton6);
        deletebutton6.setBounds(new Rectangle(new Point(665, 255), deletebutton6.getPreferredSize()));

        //---- identifylabel12 ----
        identifylabel12.setText("\u8eab\u4efd\u8bc1\uff1a");
        contentPane.add(identifylabel12);
        identifylabel12.setBounds(new Rectangle(new Point(630, 150), identifylabel12.getPreferredSize()));
        contentPane.add(identifytextField9);
        identifytextField9.setBounds(680, 145, 155, identifytextField9.getPreferredSize().height);

        //---- briefMedicalHistorylabel13 ----
        briefMedicalHistorylabel13.setText("\u7b80\u8981\u75c5\u53f2:");
        contentPane.add(briefMedicalHistorylabel13);
        briefMedicalHistorylabel13.setBounds(new Rectangle(new Point(55, 145), briefMedicalHistorylabel13.getPreferredSize()));

        //---- searchButton ----
        searchButton.setText("\u67e5\u627e");
        searchButton.addActionListener(e -> searchPatient(e));
        contentPane.add(searchButton);
        searchButton.setBounds(new Rectangle(new Point(380, 255), searchButton.getPreferredSize()));

        //======== scrollPane2 ========
        {

            //---- briefMedicalHistoryeditorPane1 ----
            briefMedicalHistoryeditorPane1.setMinimumSize(new Dimension(453, 20));
            scrollPane2.setViewportView(briefMedicalHistoryeditorPane1);
        }
        contentPane.add(scrollPane2);
        scrollPane2.setBounds(120, 145, 480, 85);

        //---- comboBox2 ----
        comboBox2.setModel(new DefaultComboBoxModel<>(new String[] {
            "1",
            "2",
            "3",
            "4",
            "5",
            "6"
        }));
        contentPane.add(comboBox2);
        comboBox2.setBounds(50, 550, 60, 30);

        //---- agespinner1 ----
        agespinner1.setModel(new SpinnerNumberModel(1, 1, 100, 1));
        contentPane.add(agespinner1);
        agespinner1.setBounds(485, 30, 55, agespinner1.getPreferredSize().height);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(895, 665);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel namelabel1;
    private JTextField nametextField1;
    private JLabel genderlabel2;
    private JComboBox<String> gendercomboBox1;
    private JLabel agelabel3;
    private JLabel birthdaylabel4;
    private JTextField birthdaytextField3;
    private JLabel phonelabel5;
    private JTextField phonetextField4;
    private JLabel subjectlabel6;
    private JTextField subjecttextField5;
    private JLabel hospitalNumberlabel7;
    private JTextField hospitalNumbertextField6;
    private JLabel caseHistorylabel8;
    private JTextField caseHistorytextField7;
    private JButton savebutton1;
    private JButton cancelbutton2;
    private JScrollPane scrollPane1;
    private JTable table1;
    private JLabel dlabel9;
    private JLabel label10;
    private JLabel pagelabel11;
    private JButton upbutton3;
    private JButton downbutton4;
    private JButton changebutton5;
    private JButton deletebutton6;
    private JLabel identifylabel12;
    private JTextField identifytextField9;
    private JLabel briefMedicalHistorylabel13;
    private JButton searchButton;
    private JScrollPane scrollPane2;
    private JEditorPane briefMedicalHistoryeditorPane1;
    private JComboBox<String> comboBox2;
    private JSpinner agespinner1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
